Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated request event with context and deprecate request_failure/success #1750

Merged
merged 21 commits into from
May 3, 2021

Conversation

DennisKrone
Copy link
Collaborator

Add a single event thats triggered both on request succes/failure #1724
This new event can contain metadata (called context) which can be specified when performing the request.

@cyberw
Copy link
Collaborator

cyberw commented Apr 23, 2021

Got some errors in the build there, but other than that (and my comments) it looks good.

Oh, and dont forget to update the xmlrpc example (both in examples/ and in extending-locust.rst)

@cyberw
Copy link
Collaborator

cyberw commented Apr 23, 2021

Oh, and write something clever in changelog.rst

Will allow getting the calling user in the request event.
Context returned from this method is forwarded in requests performed with httpSession and fastHttpSession. Allows context to be connected to a User.
@@ -322,6 +315,7 @@ def __init__(self, environment):
max_redirects=self.max_redirects,
max_retries=self.max_retries,
insecure=self.insecure,
user=self,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fudge. seems like we might as well be passing only self

@@ -32,7 +31,7 @@ using ``abstract = True`` which means that Locust will not try to create simulat

The ``XmlRpcClient`` is a wrapper around the standard
library's :py:class:`xmlrpc.client.ServerProxy`. It basically just proxies the function calls, but with the
important addition of firing :py:attr:`locust.event.Events.request_success` and :py:attr:`locust.event.Events.request_failure`
important addition of firing :py:attr:`locust.event.Events.request`
events, which will record all calls in Locust's statistics.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

event, not events :)

@cyberw cyberw marked this pull request as ready for review May 3, 2021 13:59
@cyberw cyberw merged commit 1d63adb into locustio:master May 3, 2021
@cyberw cyberw changed the title Updated request event with context Updated request event with context and deprecate request_failure/success May 3, 2021
cyberw added a commit that referenced this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants